//
//  SimulationParameters.h
//  Simulation
//
//  Created by Christopher Kemsley on 3/4/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#ifndef Simulation_SimulationParameters_h
#define Simulation_SimulationParameters_h

#include "Settings.hpp"
#include "Types.hpp"
#include "URL.hpp"
#include "Types.hpp"



struct	SimulationParameters : public Sim::Settings
{
	unsigned			dataPacketSize ;
	unsigned			controlPacketSize ;
	
	Sim::Interval		slotDuration ;
	Sim::Interval		SIFSDuration ;
	Sim::Interval		DIFSDuration ;
	
	Sim::Rate			transmissionRate ;
	
	unsigned			CW0 ;
	unsigned			CWMax ;
	unsigned			lambda ;
	
	
	
	static SimulationParameters const&	shared () ;
	
	
	
	
	// Helpful methods:
	// Probably not the best place to put this, but here it is.
	
	Sim::Interval const	randomBackoff		( unsigned lambdaScalar ) const ;
	
	Sim::Interval const	activityDuration	( unsigned long payloadLength ) const ;
	
	
	
	
	
	
	static void	loadConfiguration	( Sim::URL const & url ) ;
	
private:
	static SimulationParameters&	_shared() ;
	
	SimulationParameters () ;
	
	virtual void validate () ;
} ;



#endif
